package com.lindroy.androidplayer.ui.adapter

import androidx.fragment.app.Fragment
import com.lindroy.androidplayer.R
import com.lindroy.androidplayer.base.adapter.BaseTabAdapter
import com.lindroy.androidplayer.ui.find.fragment.KnowledgeSystemFragment
import com.lindroy.androidplayer.ui.find.fragment.NavigationIndexFragment
import com.lindroy.androidplayer.ui.find.fragment.QuestionFragment
import com.lindroy.androidplayer.ui.find.fragment.SquareFragment

/**
 * @author Lin
 * @date 2022/1/23
 * @function
 */
class FindTabAdapter(fragment: Fragment) : BaseTabAdapter<Int>(fragment) {

    override fun createItemFragment(item: Int): Fragment = when (item) {
        R.string.square -> SquareFragment()
        R.string.knowledge_system -> KnowledgeSystemFragment.newInstance()
        R.string.navigation_index -> NavigationIndexFragment()
        R.string.q_and_a -> QuestionFragment()
        else -> SquareFragment()
    }

}